/*********************************************************************************/
/*                                                                               */
/*      ADC Driver                                                               */
/*                                                                               */
/*      Last updated by:  CBS                                                    */
/*      Last update date: 12/12/25                                               */
/*      Revision:         0                                                      */
/*      Copyright:        DENSO                                                  */
/*                                                                               */
/*********************************************************************************/

/*********************************************************************************/
/*  include files                                                                */
/*********************************************************************************/
#include "MPC5674F_MVx264.h"
#include "Dma.h"
#include "Adc.h"

const struct tcd_t AdcGroupDMACommandConfig[ADC_NBR_OF_GROUPS];
const struct tcd_t AdcGroupDMAResultConfig[ADC_NBR_OF_GROUPS];

Adc_GroupStatus AdcGroupStatus[ADC_NBR_OF_GROUPS];

/* Configuration goes here */
void Adc_Group0Notification(void)
{
}

void Adc_Group1Notification(void)
{
}

void Adc_Group2Notification(void)
{
}

void Adc_Group3Notification(void)
{
}

void Adc_Group4Notification(void)
{
}

void Adc_Group5Notification(void)
{
}

const Adc_HWConfigurationType AdcHWUnitConfiguration =
{
  ADC_SYSTEM_CLOCK,                        /* clockSource */
  0,                                       /* hwUnitId */
  ADC_SYSTEM_CLOCK_DIVIDE_FACTOR_8         /* adcPrescale */
};

const Adc_ChannelConfigurationType AdcChannelConfiguration[ADC_NBR_OF_CHANNELS] =
{
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH0 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH1 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH2 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH3 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH4 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH5 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH6 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH7 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH8 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH9 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH10 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH11 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH12 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH13 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH14 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH15 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH16 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH17 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH18 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH19 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH20 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH21 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH22 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH23 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH24 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH25 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH26 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH27 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH28 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH29 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH30 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH31 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH32 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH33 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH34 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH35 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH36 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH37 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH38 */
    {ADC_CONVERSION_TIME_8_CLOCKS, ADC_REFERENCE_VOLTAGE_GROUND, ADC_REFERENCE_VOLTAGE_5V, ADC_RESOLUTION_12BITS, ADC_CALIBRATION_ENABLED},  /* ADC_CH39 */
};

const U2 ADC_NBR_OF_GROUP0_CHANNELS = 4;
const U2 ADC_NBR_OF_GROUP1_CHANNELS = 4;
const U2 ADC_NBR_OF_GROUP2_CHANNELS = 4;
const U2 ADC_NBR_OF_GROUP3_CHANNELS = 4;
const U2 ADC_NBR_OF_GROUP4_CHANNELS = 4;
const U2 ADC_NBR_OF_GROUP5_CHANNELS = 4;

const Adc_ChannelType Adc_Group0ChannelList[ADC_NBR_OF_GROUP0_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

const Adc_ChannelType Adc_Group1ChannelList[ADC_NBR_OF_GROUP1_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

const Adc_ChannelType Adc_Group2ChannelList[ADC_NBR_OF_GROUP2_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

const Adc_ChannelType Adc_Group3ChannelList[ADC_NBR_OF_GROUP3_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

const Adc_ChannelType Adc_Group4ChannelList[ADC_NBR_OF_GROUP4_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

const Adc_ChannelType Adc_Group5ChannelList[ADC_NBR_OF_GROUP5_CHANNELS] =
{
    ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3,
};

/* Ram buffers for command and result queues. These are located here in the
   configuration to be able to reconfigure system without recompiling the
   drivers. */
Adc_ValueGroupType Adc_Group0Buffer[sizeof(Adc_Group0ChannelList)/sizeof(Adc_Group0ChannelList[0])];
Adc_CommandType Adc_Group0Commands[sizeof(Adc_Group0ChannelList)/sizeof(Adc_Group0ChannelList[0])];

Adc_ValueGroupType Adc_Group1Buffer[sizeof(Adc_Group1ChannelList)/sizeof(Adc_Group1ChannelList[0])];
Adc_CommandType Adc_Group1Commands[sizeof(Adc_Group1ChannelList)/sizeof(Adc_Group1ChannelList[0])];

Adc_ValueGroupType Adc_Group2Buffer[sizeof(Adc_Group2ChannelList)/sizeof(Adc_Group2ChannelList[0])];
Adc_CommandType Adc_Group2Commands[sizeof(Adc_Group2ChannelList)/sizeof(Adc_Group2ChannelList[0])];

Adc_ValueGroupType Adc_Group3Buffer[sizeof(Adc_Group3ChannelList)/sizeof(Adc_Group3ChannelList[0])];
Adc_CommandType Adc_Group3Commands[sizeof(Adc_Group3ChannelList)/sizeof(Adc_Group3ChannelList[0])];

Adc_ValueGroupType Adc_Group4Buffer[sizeof(Adc_Group4ChannelList)/sizeof(Adc_Group4ChannelList[0])];
Adc_CommandType Adc_Group4Commands[sizeof(Adc_Group4ChannelList)/sizeof(Adc_Group4ChannelList[0])];

Adc_ValueGroupType Adc_Group5Buffer[sizeof(Adc_Group5ChannelList)/sizeof(Adc_Group5ChannelList[0])];
Adc_CommandType Adc_Group5Commands[sizeof(Adc_Group5ChannelList)/sizeof(Adc_Group5ChannelList[0])];

Adc_GroupDefType AdcGroupConfiguration [] =
{
   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group0Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group0ChannelList,                                       /* channelList */
     Adc_Group0Buffer,                                            /* resultBuffer */
     Adc_Group0Commands,                                          /* commandBuffer */
     sizeof(Adc_Group0Commands)/sizeof(Adc_Group0Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP0_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP0_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP0],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP0]},       /* groupDMAResults */

   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group1Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group1ChannelList,                                       /* channelList */
     Adc_Group1Buffer,                                            /* resultBuffer */
     Adc_Group1Commands,                                          /* commandBuffer */
     sizeof(Adc_Group1Commands)/sizeof(Adc_Group1Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP1_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP1_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP1],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP1]},       /* groupDMAResults */

   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group2Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group2ChannelList,                                       /* channelList */
     Adc_Group2Buffer,                                            /* resultBuffer */
     Adc_Group2Commands,                                          /* commandBuffer */
     sizeof(Adc_Group2Commands)/sizeof(Adc_Group2Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP2_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP2_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP2],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP2]},       /* groupDMAResults */

   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group3Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group3ChannelList,                                       /* channelList */
     Adc_Group3Buffer,                                            /* resultBuffer */
     Adc_Group3Commands,                                          /* commandBuffer */
     sizeof(Adc_Group3Commands)/sizeof(Adc_Group3Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP3_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP3_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP3],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP3]},       /* groupDMAResults */

   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group4Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group4ChannelList,                                       /* channelList */
     Adc_Group4Buffer,                                            /* resultBuffer */
     Adc_Group4Commands,                                          /* commandBuffer */
     sizeof(Adc_Group4Commands)/sizeof(Adc_Group4Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP4_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP4_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP4],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP4]},       /* groupDMAResults */

   { ADC_ACCESS_MODE_STREAMING,                                   /* accessMode */
     ADC_CONV_MODE_ONESHOT,                                       /* conversionMode */
     ADC_TRIGG_SRC_SW,                                            /* triggerSrc */
     ADC_NO_HW_TRIG,                                              /* hwTriggerSignal */
     ADC_NO_TIMER,                                                /* hwTriggerTimer */
     Adc_Group5Notification,                                      /* groupCallback */
     ADC_STREAM_BUFFER_LINEAR,                                    /* streamBufferMode */
     1,                                                           /* streamNumSamples */
     Adc_Group5ChannelList,                                       /* channelList */
     Adc_Group5Buffer,                                            /* resultBuffer */
     Adc_Group5Commands,                                          /* commandBuffer */
     sizeof(Adc_Group5Commands)/sizeof(Adc_Group5Commands[0]),    /* numberOfChannels */
     &AdcGroupStatus[ADC_GROUP0],                                 /* status */
     DMA_ADC_GROUP5_COMMAND_CHANNEL,                              /* dmaCommandChannel */
     DMA_ADC_GROUP5_RESULT_CHANNEL,                               /* dmaResultChannel */
     (struct tcd_t *)&AdcGroupDMACommandConfig[ADC_GROUP5],       /* groupDMACommands */
     (struct tcd_t *)&AdcGroupDMAResultConfig[ADC_GROUP5]},       /* groupDMAResults */
};

/******************************************************************/
/*                                                                */
/* End of user configuration area. DO NOT modify the code below!! */
/*                                                                */
/******************************************************************/
const Adc_ConfigType AdcConfig[] =
{
  {
   &AdcHWUnitConfiguration,
   AdcChannelConfiguration,
   sizeof(AdcChannelConfiguration)/sizeof(AdcChannelConfiguration[0]),
   AdcGroupConfiguration,
   sizeof(AdcGroupConfiguration)/sizeof(AdcGroupConfiguration[0])
  }
};

/* DMA configuration. */
const struct tcd_t AdcGroupDMACommandConfig [ADC_NBR_OF_GROUPS] =
{
  {
    (U4)Adc_Group0Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group0Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP0].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group0Commands)/sizeof(Adc_Group0Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group0Commands)/sizeof(Adc_Group0Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (U4)Adc_Group1Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group1Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP1].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group1Commands)/sizeof(Adc_Group1Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group1Commands)/sizeof(Adc_Group1Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (U4)Adc_Group2Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group2Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP2].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group2Commands)/sizeof(Adc_Group2Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group2Commands)/sizeof(Adc_Group2Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (U4)Adc_Group3Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group3Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP3].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group3Commands)/sizeof(Adc_Group3Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group3Commands)/sizeof(Adc_Group3Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (U4)Adc_Group4Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group4Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP4].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group4Commands)/sizeof(Adc_Group4Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group4Commands)/sizeof(Adc_Group4Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (U4)Adc_Group5Commands,                                       /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_32BITS,                                     /* Destination Data Transfer Size */
    sizeof(Adc_CommandType),                                      /* Signed Source Address Offset */
    sizeof(Adc_CommandType),                                      /* Inner ("Minor") Byte Transfer Count */
    (S4)(-sizeof(Adc_Group5Commands)),                            /* Last Source Address Adjustment */
    (volatile U4)&EQADC_A.CFPR[ADC_GROUP5].R,                       /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group5Commands)/sizeof(Adc_Group5Commands[0]),     /* Current Major Iteration Count */
    0,                                                            /* Signed Destination Address Offset */
    0,                                                            /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group5Commands)/sizeof(Adc_Group5Commands[0]),     /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active */
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  
};

const struct tcd_t AdcGroupDMAResultConfig [ADC_NBR_OF_GROUPS]=
{
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP0].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group0Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group0Buffer)/sizeof(Adc_Group0Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group0Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group0Buffer)/sizeof(Adc_Group0Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP1].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group1Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group1Buffer)/sizeof(Adc_Group1Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group1Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group1Buffer)/sizeof(Adc_Group1Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP2].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group2Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group2Buffer)/sizeof(Adc_Group2Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group2Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group2Buffer)/sizeof(Adc_Group2Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP3].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group3Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group3Buffer)/sizeof(Adc_Group3Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group3Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group3Buffer)/sizeof(Adc_Group3Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP4].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group4Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group4Buffer)/sizeof(Adc_Group4Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group4Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group4Buffer)/sizeof(Adc_Group4Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  },
  {
    (volatile U4)&EQADC_A.RFPR[ADC_GROUP5].R + 2,                   /* Source Address */
    0,                                                            /* Source Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Source Data Transfer Size */
    0,                                                            /* Destination Address Modulo */
    DMA_TRANSFER_SIZE_16BITS,                                     /* Destination Data Transfer Size */
    0,                                                            /* Signed Source Address Offset */
    sizeof(Adc_ValueGroupType),                                   /* Inner ("Minor") Byte Transfer Count */
    0,                                                            /* Last Source Address Adjustment */
    (U4)Adc_Group5Buffer,                                         /* Destination Address */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Completion */
    sizeof(Adc_Group5Buffer)/sizeof(Adc_Group5Buffer[0]),         /* Current Major Iteration Count */
    sizeof(Adc_ValueGroupType),                                   /* Signed Destination Address Offset */
    (S4)(-sizeof(Adc_Group5Buffer)),                              /* Last Destination Address Adjustment, or Scatter/Gather Address (if E_SG = 1) */
    0,                                                            /* Enable Channel-to-Channel Linking on Minor Loop Complete */
    sizeof(Adc_Group5Buffer)/sizeof(Adc_Group5Buffer[0]),         /* Starting ("Major") Iteration Count */
    0,                                                            /* Bandwidth Control */
    0,                                                            /* Link Channel Number */
    0,                                                            /* Channel Done */
    0,                                                            /* Channel Active*/
    0,                                                            /* Enable Channel-to-Channel Link */
    0,                                                            /* Enable Scatter/Gather Descriptor */
    0,                                                            /* Disable IPD_REQ When Done */
    0,                                                            /* Interrupt on CITER = (BITER >> 1) */
    0,                                                            /* Interrupt on Major Loop Completion */
    0                                                             /* Explicit Channel Start */
  }
};

/**** End Of File ****************************************************************/
